<script setup>
import GoBack from '../../components/GoBack.vue';
import SearchBox from '../../components/SearchBox.vue';
import Posts from '../../components/Posts.vue';
</script>

<script>
export default{
    provide(){
        return{
            reload:this.reload
        }
    },
    data(){
        return{
            selectID:[],
            isRouterAlive:true,
        }
    },
    methods:{
        reload(){
            this.isRouterAlive=false
            this.$nextTick(function() {
                this.isRouterAlive=true
            })
        }
    }
}
</script>

<template>
    <div class="forum">
    <GoBack></GoBack>
    <SearchBox @to-search="(select)=>{selectID=select}"></SearchBox>
    <RouterView v-if="isRouterAlive">
    <Posts :select="selectID"></Posts>
    </RouterView>   
    </div>
    
</template>

<style scoped>
.forum{
    width: 100%;
}

</style>